/*
 * @Description: 配置路由文件
 * @Autor: 田力源
 * @Date: 2023-02-17 14:42:13
 * @LastEditors: 田力源
 * @LastEditTime: 2023-02-20 14:58:54
 */
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/welcome'
    },
    {
        path: '/welcome',
        component: () => import('../views/welcome/index.vue')
    },
    {
        path: '/news',
        component: () => import('../views/news/index.vue')
    },
    {
        path: '/handBook',
        component: () => import('../views/handBook/index.vue')
    },
    {
        path: '/forum',
        component: () => import('../views/forum/index.vue')
    },
    {
        path: '/introduction',
        component: () => import('../views/introduction/index.vue')
    },
    {
        path: '/login',
        component: () => import('../views/login/index.vue')
    },
    {
        path: '/sign',
        component: () => import('../views/sign/index.vue')
    },
    {
        path: '/user',
        component: () => import('../views/user/index.vue')
    }
];

// 1.返回一个router实例，里面有配置项 history
const router = createRouter({
    history: createWebHistory(),
    routes,
})

// 导出路由 在main中注册
export default router